package com.bnz.entity;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * 采用value的方式获取配置信息
 */

@Data // 添加get，set，toString方法
@Component //注入到spring容器中
public class Book2 {

    @Value("{book.id}")
    private Integer id;

    @Value("{book.name}")
    private String name;

    @Value("{book.author}")
    private String author;

}
